﻿using System.Web.Mvc;
using AutoMapper;
using WebApp.ModelService;
using WebApp.Services;

namespace WebApp.Controllers
{
    public class SearchController : SmartController
    {
        private readonly IAttachmentModelService _attachmentModelService;
        public SearchController(IUserSession userSession, IMappingEngine mappingEngine, IAttachmentModelService attachmentModelService)
            : base(userSession, mappingEngine)
        {
            _attachmentModelService = attachmentModelService;
        }

        [Authorize]
        public ViewResult Index(string id)
        {
            var response = _attachmentModelService.GetAttachmentsBySearchValue(id);
            return View(response);
        }
    }
}
